package 二叉树;
import java.awt.Button;
import java.awt.EventQueue;
import java.awt.Image;

import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextPane;
public class View {
	public static void main(String[] args) {
		EventQueue.invokeLater(() -> {
			//JFrame frame = new FristFrame();
			FristFrame frame = new FristFrame();
			frame.setTitle("请先建立树");//设置标题
			// 定义用户关闭框架时的响应动作
			frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
			frame.setLocationByPlatform(true);// 系统自动确定窗口位置
			
			frame.setVisible(true);
			// frame.remove(p);
			// frame.setVisible(true);
		});
	}
}

class FristFrame extends JFrame{//绘制框架
	
	
	private static final long serialVersionUID = 1L;
	//private static final int DEFAULT_WIDTH = 1280;
	//private static final int DEFAULT_HEIGHT = 720;
	public FristFrame() {
		/*获取屏幕宽高*/
		/*
		Toolkit kit = Toolkit.getDefaultToolkit();
		Dimension screenSize = kit.getScreenSize();
		//int screenWidth = screenSize.width;
		//int screenHeight = screenSize.height;
		setSize(screenWidth/2 ,screenWidth/2);
		*/
		//Tex
		JPanel jPanel = new JPanel();
		jPanel.setBounds(100, 100, 250, 200);
		//jPanel.setLayout(null);
		JLabel jLabel = new JLabel("请输入扩展先序序列：");
		JTextPane text = new JTextPane();
		text.setText("ABC##DE#G##F###");
		Button button = new Button("OK");
		button.addActionListener(event -> Main());
		jPanel.add(jLabel);
		jPanel.add(text);
		jPanel.add(button);
		add(jPanel);
		Image img = new ImageIcon("icon.gif").getImage();
		setIconImage(img);
		pack();
	}
	public void Main() {
		TreeList tree = new TreeList("A##");
		
	}
}
